<template>
  <div class="timeLine">
    <div class="timeLine-center">
      <div class="timeLine-sjx">
        <div class="timeLine-sjxs">
          <span>{{ title }}</span>
        </div>
        <el-timeline>
          <el-timeline-item v-for="(item, index) in activities" :key="index" :timestamp="item.flowTime" color="#CDDCF7">
            {{ item.flowName }}
          </el-timeline-item>
        </el-timeline>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "TimeLine",
  props: {
    title: {
      type: String,
      default: "时间轴"
    },
    activities: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
    };
  },
  methods: {
    AddFh() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped lang="less">
.timeLine {
  width: 16%;
  height: 100%;
}

.timeLine-center {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
}

.timeLine-sjx {
  width: 100%;
  height: 100%;
  background-color: #fff;
  border-radius: 5px;
  overflow-x: auto;

  :deep(.el-timeline) {
    width: 88%;
    margin-left: 35px;
    margin-top: 30px;
    font-size: 18px;

    .el-timeline-item__node--normal {
      left: -2px;
      width: 15px;
      height: 15px;
    }

    .el-timeline-item__tail {
      border-left: 2px dashed #e4e7ed;
    }

    .el-timeline-item__wrapper {
      padding: 5px 0;
      padding-left: 10px;
      margin-left: 28px;
      top: -10px;
    }

    & :last-child {
      .el-timeline-item__node--normal {
        background-color: #256dfc !important;
      }

      .el-timeline-item__wrapper {
        background: #256dfc;
        border-radius: 4px;

        .el-timeline-item__content {
          color: #fff;
        }

        .el-timeline-item__timestamp.is-bottom {
          color: #fff;
        }
      }
    }
  }
}

.timeLine-sjxs {
  padding: 10px 20px;

  span {
    border-left: 4px solid rgb(9, 139, 245);
    padding-left: 10px;
  }
}
</style>
